package com.itheima.day09;

import java.util.Scanner;

public class TestStudent {
    public static void main(String[] args) {
        //1.键盘录入一个字符串
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入学生信息:");
        String studInfo = sc.next();

        //2.切割逗号得到字符串
        String[] sArr = studInfo.split(",");

        //3.取出sArr[0]和[1]上的数
        Student stu = new Student(sArr[0],sArr[1]);
        //4.调用对象,输出打印
        System.out.println(stu.getName() + "..." + stu.getAge());
    }
}
class Student{
    private String name;
    private String age;
    public Student(){}

    public Student(String name, String age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }
}